import { Entity, Column, PrimaryGeneratedColumn, CreateDateColumn } from 'typeorm';

@Entity({name: 'ai_task', synchronize: false})
export class Task {
    @PrimaryGeneratedColumn()
    id: number;

    @Column()
    emp_id: number;

    @Column({ length: 255 })
    emp_name: string;

    @Column({ length: 30 })
    email: string;

    @Column({ length: 255 })
    discord_session: string;

    @Column()
    prompt: string;

    /** 中文prompt */
    @Column()
    chinese_prompt: string;

    @Column()
    response: string;

    @Column()
    response_url: string;

    @Column()
    oss_url: string;

    @CreateDateColumn({ type: 'timestamp' }) // 使用 @CreateDateColumn 表示创建时间
    created_time: Date;

    @CreateDateColumn({ type: 'timestamp' }) // 使用 @CreateDateColumn 表示创建时间
    response_time: Date;

    @Column()
    response_state: number;

    @Column()
    progress: string; // 生成进度

    @Column()
    account_id: number;

    @CreateDateColumn({ type: 'timestamp' }) // 使用 @CreateDateColumn 表示创建时间
    modified_time: Date;
}
